feat(block-kit): add data table block example#98
Draft
zimeg wants to merge 1 commit into
Draft
Conversation
Add a data_table Block Kit example mirroring the official docs example, including a typed DataTableBlock (net-new; not yet in slack_sdk), a unit test asserting the produced block, and a README entry. Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a
data_tableBlock Kit example to theblock-kitshowcase, mirroring the official docs example.The
data_tableblock is net-new and is not yet inslack_sdk(confirmed absent in the pinnedslack_sdk==3.42.0). This example defines a small, typedDataTableBlockthat subclasses the SDK'sslack_sdk.models.blocks.Blockbase class, following the same implementation pattern the SDK uses forTableBlock(validators for the requiredrowsandcaptionfields,attributescoveringrows,caption,page_size,row_header_column_index,block_id). When the SDK ships a nativeDataTableBlock, this example can be swapped to import it directly.block-kit/src/blocks/data_table.py—example01()returning aDataTableBlock(raw text header + raw text / rich text cells, with a caption), mirroring the docs example JSON.block-kit/tests/blocks/test_data_table.py— asserts the produced block deep-equals the expected literal (same style astest_table.py/test_task_card.py).block-kit/README.md— alphabetical "Data table" entry with docs + implementation links.Docs
https://docs.slack.dev/reference/block-kit/blocks/data-table-block
Validation
Run in
block-kit/against the pinnedrequirements.txt(slack_sdk==3.42.0):ruff check— passedruff format --diff --check— passed (new files already formatted)mypy src/blocks/data_table.py tests/blocks/test_data_table.py— passed (no issues)pytest tests/blocks/test_data_table.py -v— passed (1 passed)pytest -v— all data table tests passNote: a repo-wide
mypy ./**/*.pycurrently reports pre-existing errors insrc/blocks/carousel.py(unrelated work not part of this PR); the files added here are mypy-clean.Co-Authored-By: Claude svc-devxp-claude@slack-corp.com